import { computed, toRefs } from 'vue'
export default {
    props: {
        mode: {
          type: String,
          default: 'DESIGN',
        },
        required: {
          type: Boolean,
          default: false,
        },
        readonly: {
          type: Boolean,
          default: false,
        },
        modelValue: {
            type: Boolean,
            default: false,
        }
    },
    emits: ['update:modelValue'],
    setup(props, context) {
        const { modelValue } = toRefs(props)
        const _value = computed({
            get: () => {
                return modelValue.value
            },
            set: val => {
                context.emit('update:modelValue', val)
            }
        })
        return {
            _value
        }
    }
}